OS Detection in ZSH
Zsh will do some OS detection for you, so you don’t need to rely
on shelling out to uname any more: $OSTYPE is set to a useful value.
From zsh’s documentation:
OSTYPE: The operating system, as determined at compile time.
Examples
On my Arch Linux laptop, $OSTYPE is set to linux-gnu.
On my M1 Macbook, $OSTYPE is set to darwin.